package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Language generated by hbm2java
 */
@Entity
@Table(name = "language", catalog = "tms")
public class Language implements java.io.Serializable {

	private Long id;
	private long version;
	private Date createDate;
	private String creator;
	private String description;
	private String name;
	private String status;
	private Set<TranslateItem> translateItems = new HashSet<TranslateItem>(0);
	private Set<Project> projects = new HashSet<Project>(0);
	private Set<Project> projects_1 = new HashSet<Project>(0);

	public Language() {
	}

	public Language(String status) {
		this.status = status;
	}

	public Language(Date createDate, String creator, String description, String name, String status,
			Set<TranslateItem> translateItems, Set<Project> projects, Set<Project> projects_1) {
		this.createDate = createDate;
		this.creator = creator;
		this.description = description;
		this.name = name;
		this.status = status;
		this.translateItems = translateItems;
		this.projects = projects;
		this.projects_1 = projects_1;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "creator")
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "language")
	public Set<TranslateItem> getTranslateItems() {
		return this.translateItems;
	}

	public void setTranslateItems(Set<TranslateItem> translateItems) {
		this.translateItems = translateItems;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "language")
	public Set<Project> getProjects() {
		return this.projects;
	}

	public void setProjects(Set<Project> projects) {
		this.projects = projects;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "language_project", catalog = "tms", joinColumns = {
			@JoinColumn(name = "language_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "project_id", nullable = false, updatable = false) })
	public Set<Project> getProjects_1() {
		return this.projects_1;
	}

	public void setProjects_1(Set<Project> projects_1) {
		this.projects_1 = projects_1;
	}

}
